<template>
	<view class="class-list">
		<view class="class" >
			<view class="class-text" @click="toStudent(item.id,item.className)"  v-for="item in classList">
				<p>{{item.className}}</p>
			</view>
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				classList:[],
				kgId:null,
			}
		},
		
		onLoad() {
			this.kgId = uni.getStorageSync("kgId")
			this.getClassList()
		},
		methods: {
			toStudent(id,className){
				uni.$common.navigateTo("/pages/student/student?classId="+id+"&className="+className)
			},
			
			getClassList(){
				uni.$api.classFindList(this.kgId).then(result =>{
					this.classList = result
				})
			}
		}
	}
</script>

<style>
.class{
	width: 90%;
	margin-top: 20px;
	margin-left: 20px;
	
}
.class-text{
	width: 45%;
	height: 80px;
	/* background: url("/static/me/背景.jpg") no-repeat; */
/* 	background-size: 100%; */
	background-color: #F7CC60;
	display: inline-block;
	margin-left: 15rpx;
	margin-right: 20rpx;
	margin-bottom: 30rpx;
	border-radius: 10rpx;
	text-align: left;
	padding-left: 30rpx;
}
.class-text p{
	line-height: 100rpx;
	color: #804215;
}
</style>